package com.jrx.anytxn.transaction.service.impl;

import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.common.uitl.BeanMapping;
import com.jrx.anytxn.transaction.dto.loan.AmWaiveRepaymentPlanInfoRes;
import com.jrx.anytxn.transaction.dto.loan.TlLoanStagingMappingRes;
import com.jrx.anytxn.transaction.entity.TlLoanStagingMapping;
import com.jrx.anytxn.transaction.mapper.ext.ExtTlLoanStagingMappingMapper;
import com.jrx.anytxn.transaction.service.ITlLoanStagingMappingService;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 账单分期关联关系表service实现
 *
 * @author yf
 * date 2020/4/13 0013
 * @version V1.0
 **/
@Service
public class TlLoanStagingMappingServiceImpl implements ITlLoanStagingMappingService {

    @Resource
    private ExtTlLoanStagingMappingMapper extTlLoanStagingMappingMapper;


    @Override
    public List<TlLoanStagingMappingRes> getLoanStageListByLoanIdAndCusId(String tenantId, String customerId,String loanId) throws TxnBizException {
        List<TlLoanStagingMapping> tlLoanStagingMappingList= extTlLoanStagingMappingMapper.selectByStagingLoanIdByCusId(customerId,tenantId,loanId);
        return BeanMapping.copyList(tlLoanStagingMappingList,TlLoanStagingMappingRes.class);
    }
}
